home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 168 / 168.d81 / spot finder (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  4KB  |  180 lines

  1. 5 poke55,.:poke56,56:clr
  2. 6 dv=peek(186):ifdv<8thendv=8
  3. 7 print"[147]":poke53280,.:poke53281,.
  4. 9 poke53272,31
  5. 10 poke53371,.
  6. 12 ad=49152
  7. 14 sysad:sysad+12
  8. 40 rem jupiter's central meridian
  9. 45 bs$="[129][164][157][164][157][164][157][164][157][164][157][164][157][164][157][164][157][164][157][164][157][164][157][164][157][164][157][164][157][164][157][164][157][164][157][164][157][164][157][164][157][164][157][164]"
  10. 50 dt=57
  11. 55 p2=2*(NULL):rd=180/(NULL):dr=1/rd
  12. 60 gosub295:rem get date and ut
  13. 65 d=(j-2451545)+f
  14. 70 d=d+dt/86400:rem ut to et
  15. 75 gosub395
  16. 80 reada1,a2,d1,d2
  17. 85 t=t-1:rem cent from 2000.0
  18. 90 a1=a1+a2*t
  19. 95 d1=d1+d2*t
  20. 100 q=a1:gosub690:a1=q*dr
  21. 105 q=d1:gosub690:d1=q*dr
  22. 110 d9=cos(d5)*sin(a1-a5)
  23. 115 n9=sin(d1)*cos(d5)*cos(a1-a5)
  24. 120 n9=n9-cos(d1)*sin(d5)
  25. 125 k=rd*atn(n9/d9)
  26. 130 ifd9<0thenk=k+180
  27. 135 :
  28. 140 readw0,w1,w2:rem system i
  29. 145 gosub220
  30. 150 sysad+9,15
  31. 151 poke214,10:print:printtab(1)"[156][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162]"
  32. 153 print:printtab(4)"[153][195]entral-[205]eridian ([201]):";c;"[219]"
  33. 155 printtab(4)"[150][198]or [208]lanet [202]upiter (long)"
  34. 160 readw0,w1,w2:rem system ii
  35. 165 gosub220
  36. 170 print:printtab(4)"[153][195]entral-[205]eridian ([201][201]):";c;"[219]"
  37. 172 printtab(4)"[150][198]or [199]reat [210]ed [211]pot (long)"
  38. 175 print:printtab(3)"[153][204]ocation-"
  39. 176 ifc>=25andc<35thengosub750
  40. 177 ifc>1andc<25thengosub755
  41. 178 ifc>35andc<90thengosub760
  42. 179 ifc>90andc<360thengosub765
  43. 180 gosub4000
  44. 190 restore:goto40
  45. 220 rem  rotations from epoch
  46. 225 w=w0+w1*(d-.0057755*rr)+w2*t
  47. 230 q=w-k:gosub690:c=q
  48. 235 c=int(100*c+.5)/100
  49. 240 return
  50. 245 rem north pole r.a.
  51. 250 data268.05,+0.107
  52. 255 rem  north pole declin
  53. 260 data64.49,-0.015
  54. 265 rem system i
  55. 270 data67.10,877.9000,1.291
  56. 275 rem system ii
  57. 280 data43.30,870.2700,1,291
  58. 285 :
  59. 290 rem calendar ---> jd
  60. 295 print"[147]":sysad+9,7
  61. 296 print"[129][220][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][221]"
  62. 297 printbs$""tab(38)bs$
  63. 298 print"[129][255][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][161]"
  64. 300 print""tab(5)"[154]-[150][198][201][206][196] [212][200][197] [199][210][197][193][212] [210][197][196] [211][208][207][212][154]-"
  65. 302 printtab(6)"[158][197]nter [217]ear: ";:l9%=4:gosub705:y=q9
  66. 305 printtab(6)"[158][197]nter [205]onth: ";:l9%=2:gosub705:m=q9
  67. 307 ifm=<0orm>12thenprint"[145][145]":goto305
  68. 310 printtab(6)"[158][197]nter [196]ay: ";:l9%=2:gosub705:d=q9
  69. 312 ifd=<0ord>31thenprint"[145][145]":goto310
  70. 315 printtab(6)"[158][197]nter [213][212] [200]our: ";:l9=2:gosub705:h1=q9
  71. 317 ifh1<0orh1>24thenprint"[145][145]":goto315
  72. 320 printtab(6)"[158][197]nter [205]inutes: ";:l9=2:gosub705:m1=q9
  73. 322 ifm1<0orm1>60thenprint"[145][145]":goto320
  74. 324 printtab(6)"[158][197]nter [211]econds: ";:l9=2:gosub705:s1=q9
  75. 325 ifs1<0ors1>60thenprint"[145][145]":goto324
  76. 327 poke214,10:print:printtab(4)"[159][201]s the information correct? [155][217]/[206]":poke198,.
  77. 328 gethc$:ifhc$<>"y"andhc$<>"n"then328
  78. 329 ifhc$="n"then290
  79. 330 d=d+h1/24+m1/1440+s1/86400
  80. 332 sysad+9,9
  81. 335 g=1:ify<1582then g=0
  82. 340 d1=int(d):f=d-d1-.5
  83. 345 j=-int(7*(int((m+9)/12)+y)/4)
  84. 350 ifg=0then370
  85. 355 s=sgn(m-9):a=abs(m-9)
  86. 360 j3=int(y+s*int(a/7))
  87. 365 j3=-int((int(j3/100)+1)*3/4)
  88. 370 j=j+int(275*m/9)+d1+g*j3
  89. 375 j=j+1721027+2*g+367*y
  90. 380 iff>0then390
  91. 385 f=f+1:j=j-1
  92. 390 return
  93. 395 rem  fundamental arguments
  94. 400 :
  95. 405 t=d/36525+1
  96. 410 rem t=centuries from 1900.0
  97. 415 l0=.779072+.00273790931*d
  98. 420 g0=.993126+.0027377785*d
  99. 425 l5=.089608+.00023080893*d
  100. 430 g5=.056531+.00023080893*d
  101. 435 g6=.882987+.00009294371*d
  102. 440 l0=(l0-int(l0))*p2
  103. 445 g0=(g0-int(g0))*p2
  104. 450 l5=(l5-int(l5))*p2
  105. 455 g5=(g5-int(g5))*p2
  106. 460 g6=(g6-int(g6))*p2
  107. 465 l=6910*sin(g0)
  108. 470 l=l+72*sin(2*g0)
  109. 475 l=l-17*t*sin(g0)
  110. 480 l=l-7*cos(g0-g5)
  111. 485 r=1.00014-.01675*cos(g0)
  112. 490 r=r-.00014*cos(2*g0)
  113. 495 l=l0+l/206265
  114. 500 rem juipter
  115. 505 j=19934*sin(g5)
  116. 510 j=j+5023*t+2511
  117. 515 j=j+1093*cos(2*g5-5*g6)
  118. 520 j=j+601*sin(2*g5)
  119. 525 j=j-479*sin(2*g5-5*g6)
  120. 530 j=j-185*sin(2*g5-2*g6)
  121. 535 j=j+137*sin(3*g5-5*g6)
  122. 540 j=j-131*sin(g5-2*g6)
  123. 545 b=-4692*cos(g5)
  124. 550 b=b+227-227*cos(2*g5)
  125. 555 b=b+30*t*sin(g5)
  126. 560 r5=5.20883-.25122*cos(g5)
  127. 565 r5=r5-.00604*cos(2*g5)
  128. 570 r5=r5+.0026*cos(2*g5-2*g6)
  129. 575 r5=r5-.0017*cos(3*g5-5*g6)
  130. 580 r5=r5-.00106*sin(2*g5-2*g6)
  131. 585 r5=r5-.00091*t*sin(g5)
  132. 590 r5=r5-.00084*t*cos(g5)
  133. 595 l5=l5+j/206265:b5=b/206265
  134. 600 n9=r5*cos(b5)*sin(l5-l)
  135. 605 d9=r5*cos(b5)*cos(l5-l)+r
  136. 610 l1=atn(n9/d9)
  137. 615 ifd9<0thenl1=l1+(NULL)
  138. 620 ll=l1+l
  139. 625 v=n9*n9+d9*d9
  140. 630 rr=sqr(v+(r5*sin(b5))^2)
  141. 635 s=r5*sin(b5)/rr
  142. 640 bb=atn(s/sqr(1-s*s))
  143. 645 e=(88428-47*t)/206265
  144. 650 n9=sin(ll)*cos(e)-tan(bb)*sin(e)
  145. 655 d9=cos(ll):a5=atn(n9/d9)
  146. 660 ifd9<0thena5=a5+(NULL)
  147. 665 s=sin(bb)*cos(e)
  148. 670 s=s+cos(bb)*sin(e)*sin(ll)
  149. 675 d5=atn(s/sqr(1-s*s))
  150. 680 return
  151. 685 :
  152. 690 rem normalize degrees
  153. 695 q=q/360:q=q-int(q):q=q*360
  154. 700 return
  155. 705 q9$="":poke198,.
  156. 707 geta$
  157. 709 poke646,rnd(1)*15+1:print"*[157]";:ifa$=""then707
  158. 711 ifa$=chr$(13)thenprint" ":q9=val(q9$):return
  159. 713 if(a$=chr$(20)andlen(q9$))thenq9$=left$(q9$,len(q9$)-1):goto725
  160. 715 iflen(q9$)>=l9%thensysad+9,6:goto707
  161. 717 if(a$>="0"anda$<="9")ora$="."ora$="-"then721
  162. 719 goto707
  163. 721 q9$=q9$+a$
  164. 723 print""a$;:sysad+9,6:goto707
  165. 725 print" [157][157] [157]";:goto707
  166. 750 print:printtab(13)"[145][145][[159][211]pot is [195]enter [211]tage!]":return
  167. 755 print:printtab(13)"[145][145][[159][206]ot [209]uite there [217]et!]":return
  168. 760 print:printtab(13)"[145][145][[159][202]ust missed it [196]arn!]":return
  169. 765 print:printtab(13)"[145][145][[159][195]lean out of sight!]":return
  170. 4000 poke214,20:print:printtab(8)"[159](1[159])[154] [212]ry another one
  171. 4005 [153][163]8)"open(2open)cont (NULL)o (NULL)(NULL)right$(NULL)val(NULL)(NULL)val (NULL)enu
  172. 4010 sysad+9,9:poke198,0
  173. 4015 geta$:ifa$<"1"ora$>"2"then4015
  174. 4020 ifa$="1"thenreturn
  175. 4025 sysad+15
  176. 4030 print"[147][144]load"chr$(34)"b.universe ii"chr$(34)","dv
  177. 4035 print"run28"
  178. 4040 poke631,13:poke632,13:poke198,2:end
  179. 10000 d=peek(186):n$="spot finder":open15,d,15,"s0:"+n$:close15:saven$,d:end
  180.